import request from '@/utils/request.js'

// 获取购物车列表 {{host}}/member/personal/material
/**
 * @param name 昵称
 * @param avatar 头像ID
*/
export const GetUserInfoApi = (params) => {
	return request('/member/personal/material', params)
}

// 我的收藏 {{host}}/shop/Collection/myCollection
/**
 * @param page
 * @param page_size
 * @param filters { recommend: 1, category_id: 1,2, shop_id, prefecture, search }
 * @param sort { sales, price }
*/
export const GetMyCollectApi = (params) => {
	return request('/shop/Collection/myCollection', params)
}

// 我的足迹 {{host}}/shop/Browser/myBrowser2
/**
 * @param page
 * @param page_size
 * @param filters { recommend: 1, category_id: 1,2, shop_id, prefecture, search }
 * @param sort { sales, price }
*/
export const GetMyBrowserApi = (params) => {
	return request('/shop/Browser/myBrowser2', params)
}

// 删除我的足迹 {{host}}/shop/Browser/browser_del
/**
 * @param ids 足迹ID
*/
export const DelMyBrowserApi = (params) => {
	return request('/shop/Browser/browser_del', params)
}

// 收藏店铺 {{host}}/shop/collection/shop_like_list
/**
 * @param shop_id
 * @param longitude
 * @param latitude
*/
export const GetMyCollectShopApi = (params) => {
	return request('/shop/collection/shop_like_list', params)
}

// 成为骑手 {{host}}/member/Member_rider/applyRider
export const BecomeRiderApi = (params) => {
	return request('/member/Member_rider/applyRider', params)
}

// 获取骑手申请状态 {{host}}/member/Member_rider/getApplyRider
 export const GetApplyRiderApi = () => {
 	return request('/member/Member_rider/getApplyRider', {type: 2})
 }
 
 // 申请成为代理商 {{host}}/member/member_company/add_company
 export const BecomeAgentApi = (params) => {
 	return request('/member/member_company/add_company', params)
 }
 
 // 获取代理商申请状态 {{host}}/member/member_company/get_company
 export const GetBecomeAgentApi = () => {
 	return request('/member/member_company/get_company', { type: 2 })
 }
 
 // 获得主营类目 {{host}}/shop/category/category
 /**
	* @param goods_type 固定值 2
	* @param search
*/
 export const GetMainCategoryApi = (params) => {
 	return request('/shop/category/category', params)
 }
 
 // 企业/个人 入驻 {{host}}/shop/shop/apply_shop
 export const EnterShopApi = (params) => {
 	return request('/shop/shop/apply_shop', params)
 }
 
 // 获取入驻商家状态 {{host}}/shop/shop/get_apply_shop
 export const GetEnterShopApi = () => {
 	return request('/shop/shop/get_apply_shop')
 }
 
 // 获取收货地址列表 {{host}}/member/address/get_list
 /**
  * @param page
  * @param page_size
 */
 export const GetAddressApi = (params) => {
 	return request('/member/address/get_list', params)
 }
 
 // 新增收货地址 {{host}}/member/address/add
 /**
  * @param name
  * @param phone
  * @param region  所在区域：例 410327
  * @param addr    详细地址
  * @param is_default 1默认 0不默认
  * @param longitude
  * @param latitude
 */
 export const AddAddressApi = (params) => {
 	return request('/member/address/add', params)
 }
 
 // 修改收货地址 {{host}}/member/address/edit
 /**
  * @param name
  * @param region  所在区域：例 410327
  * @param addr    详细地址
  * @param phone
  * @param is_default 1默认 0不默认
 */
 export const EditAddressApi = (params) => {
 	return request('/member/address/edit', params)
 }
 
 // 删除收货地址 {{host}}/member/address/do_delete
 /**
  * @param id
 */
 export const DelAddressApi = (params) => {
 	return request('/member/address/do_delete', params)
 }
 
 // 设为默认地址 {{host}}/member/address/set_default
 /**
  * @param id
 */
 export const SetDefaultAddressApi = (params) => {
 	return request('/member/address/set_default', params)
 }
 
 // 我的评价 {{host}}/shop/goods/goods_comment_member
 /**
  * @param shop_id
 */
 export const GetMyEvaApi = (params) => {
 	return request('/shop/goods/goods_comment_member', params)
 }
 
 // 编辑个人资料 {{host}}/member/personal/changeInfo
 /**
  * @param name
  * @param avatar
 */
 export const EditUserInfoApi = (params) => {
 	return request('/member/personal/changeInfo', params)
 }
 
 // 修改密码 {{host}}/member/personal/changePass
 /**
  * @param oldpass   旧密码
  * @param loginpass 新密码
  * @param quepass   确认密码
 */
 export const EditPasswordApi = (params) => {
 	return request('/member/personal/changePass', params)
 }
 
 // 账号注销 {{host}}/member/personal/logout
 export const LogoutApi = (params) => {
 	return request('/member/personal/logout', params)
 }
 
 // 更换手机号 {{host}}/member/member/change_mobile
 /**
  * @param mobile 新手机号
  * @param code   验证码
  * @param type   1
 */
 export const ChangePhoneApi = (params) => {
 	return request('/member/member/change_mobile', params)
 }
 
 // 意见反馈 {{host}}/member/personal/feedback
 /**
  * @param title   反馈类型
  * @param content 反馈内容
  * @param name   
  * @param phone  
  * @param pic     图片 单图
 */
 export const FeedBackApi = (params) => {
 	return request('/member/personal/feedback', params)
 }